<template>
  <div  class="text" v-show="isShow">
      本数据仅供参考，具体以<span v-show="hosName">{{hosName}}</span>医院实际业务为准
  </div>
</template>

<script>
export default {
  name: 'tips',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      isShow:true
    }
  },
  props:['hosName'],
  created(){
      var that = this
      window.onscroll = function(){
   		//变量scrollTop是滚动条滚动时，距离顶部的距离
   		var scrollTop = document.documentElement.scrollTop||document.body.scrollTop;
   		//变量windowHeight是可视区的高度
   		var windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
   		//变量scrollHeight是滚动条的总高度
   		var scrollHeight = document.documentElement.scrollHeight||document.body.scrollHeight;
               //滚动条到底部的条件
               if(scrollTop+windowHeight==scrollHeight){
                //写后台加载数据的函数
         	        that.isShow =true
                  
              }    else {
                that.isShow =false
              }
              that.$emit('scrollEnd',that.isShow)
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.text{
    text-align: center;
    color:#999;
    font-size: 0.9rem;
    padding:0.5rem 0;
    // background: #fff;
    position: fixed;
    bottom:0;
    left:0;
    width:100%;
}
</style>
